package com.sservice.service.service.impl;

import com.sservice.model.dao.ReportNumberMapper;
import com.sservice.model.entity.ReportNumber;
import com.sservice.model.vo.ReportNumberVo;
import com.sservice.service.service.IReportNumberService;
import com.sservice.base.entity.dto.ListResult;
import com.sservice.base.entity.dto.Pagination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by suweiming on 2017/12/20.
 */

@Service
public class ReportNumberServiceImpl implements IReportNumberService {

    @Autowired
    ReportNumberMapper mapper;

    @Override
    public Object create(ReportNumber apb) {
        return null;
    }

    @Override
    public ListResult page(ReportNumberVo apb) {
        List<ReportNumberVo> list = mapper.queryByPage(apb);
        int total = mapper.queryByCount(apb);
        Pagination page = new Pagination(apb.getPage(), total, apb.getSize());
        ListResult res = new ListResult(true, list);
        res.setPage(page);
        return res;
    }
}
